package com.zyf.chapter02.structure.flyweight.piece;

import java.util.HashMap;
import java.util.Map;

/**
 * 颜色
 * @author yifeng
 */
public class ChessBoard {
    private Map<Integer, ChessPiece> chessPieces = new HashMap<>();

    private void init() {
        chessPieces.put(1, new ChessPiece(1,"車", ChessPiece.Color.BLACK, 0, 0));
        chessPieces.put(2, new ChessPiece(2,"馬", ChessPiece.Color.BLACK, 0, 1));
        // 省略摆放其他棋子的代码
    }

    public void move(int chessPieceId, int toPositionX, int toPositionY) {
        // ... 省略 ...
    }
}
